package org.example.mq.consumer.impl;

import com.aliyun.openservices.ons.api.Action;
import com.aliyun.openservices.ons.api.ConsumeContext;
import com.aliyun.openservices.ons.api.Message;
import lombok.extern.slf4j.Slf4j;
import org.example.mq.consumer.AbstractMQConsumer;
import org.springframework.stereotype.Component;

/**
 * @author: TYH
 * @createTime: 2024/5/13
 * @description:
 */
@Component
@Slf4j
public class Test1MqConsumer extends AbstractMQConsumer {



    private String topic;

    @Override
    protected Action handler(Message message, ConsumeContext context, Long mqLogId) {
        try {
            return Action.CommitMessage;
        } catch (Exception e) {
            log.error("初始化合同流程报错:", e);
            return Action.ReconsumeLater;
        }
    }

    @Override
    public String getTopic() {
        return "TOPIC_LEE_TEST1";
    }
}
